package de.hm.edu.cep;

import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.UpdateListener;

import de.hm.edu.c2dm.MessageUtil;

/**
 * Listener class for KPIEvents that sends a C2DM message to all registered recipients
 * 
 * @author Peter Goldenbogen (Munich University of Applied Science)
 * @version 1.0 
 */
public class KPIEventListener implements UpdateListener{
	
	@Override
	public void update(EventBean[] newEvents, EventBean[] oldEvents) {
		
		EventBean event = newEvents[0];
		MessageUtil.c2dmPush("High Sales Volume! " + event.get("timestamp"));
	}
}
